$\mathit{RO}_\mathit{run}$ & {\tt API\_version/vendor\_implementation} & (string $\rightarrow$ string) Map & details of vendor implementation \\
$\mathit{RO}_\mathit{run}$ & {\tt software\_version} & (string $\rightarrow$ string) Map & version strings \\
$\mathit{RW}$ & {\tt other\_config} & (string $\rightarrow$ string) Map & additional configuration \\
+$\mathit{RO}_\mathit{run}$ & {\tt capabilities} & string Set & Xen capabilities \\
$\mathit{RO}_\mathit{run}$ & {\tt supported\_bootloaders} & string Set & a list of the bootloaders installed on the machine \\
$\mathit{RO}_\mathit{run}$ & {\tt resident\_VMs} & (VM ref) Set & list of VMs currently resident on host \\
$\mathit{RW}$ & {\tt logging} & (string $\rightarrow$ string) Map & logging configuration \\
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_capabilities}
+
+{\bf Overview:}
+Get the capabilities field of the given host.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (string Set) get_capabilities (session_id s, host ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+string Set
+}
+
+
+value of the field
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
xen_string_string_map *api_version_vendor_implementation;
xen_string_string_map *software_version;
xen_string_string_map *other_config;
+ struct xen_string_set *capabilities;
struct xen_string_set *supported_bootloaders;
struct xen_vm_record_opt_set *resident_vms;
xen_string_string_map *logging;
xen_host_get_other_config(xen_session *session, xen_string_string_map **result, xen_host host);
+/**
+ * Get the capabilities field of the given host.
+ */
+extern bool
+xen_host_get_capabilities(xen_session *session, struct xen_string_set **result, xen_host host);
+
+
/**
* Get the supported_bootloaders field of the given host.
*/
{ .key = "other_config",
.type = &abstract_type_string_string_map,
.offset = offsetof(xen_host_record, other_config) },
+ { .key = "capabilities",
+ .type = &abstract_type_string_set,
+ .offset = offsetof(xen_host_record, capabilities) },
{ .key = "supported_bootloaders",
.type = &abstract_type_string_set,
.offset = offsetof(xen_host_record, supported_bootloaders) },
xen_string_string_map_free(record->api_version_vendor_implementation);
xen_string_string_map_free(record->software_version);
xen_string_string_map_free(record->other_config);
+ xen_string_set_free(record->capabilities);
xen_string_set_free(record->supported_bootloaders);
xen_vm_record_opt_set_free(record->resident_vms);
xen_string_string_map_free(record->logging);
}
+bool
+xen_host_get_capabilities(xen_session *session, struct xen_string_set **result, xen_host host)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = host }
+ };
+
+ abstract_type result_type = abstract_type_string_set;
+
+ *result = NULL;
+ XEN_CALL_("host.get_capabilities");
+ return session->ok;
+}
+
+
bool
xen_host_get_supported_bootloaders(xen_session *session, struct xen_string_set **result, xen_host host)
{
return 1;
}
+ xen_string_set *capabilities;
+ if (!xen_host_get_capabilities(session, &capabilities, host))
+ {
+ print_error(session);
+ free(dmesg);
+ xen_string_set_free(supported_bootloaders);
+ xen_string_string_map_free(versions);
+ xen_host_free(host);
+ xen_vm_record_free(vm_record);
+ xen_uuid_bytes_free(vm_uuid_bytes);
+ xen_uuid_free(vm_uuid);
+ xen_vm_free(vm);
+ CLEANUP;
+ return 1;
+ }
+
printf("%s.\n", vm_uuid);
fprintf(stderr, "In bytes, the VM UUID is ");
}
printf("\n");
+ printf("Host has the following capabilities:");
+ for (size_t i = 0; i < capabilities->size; i++)
+ {
+ printf(" %s", capabilities->contents[i]);
+ }
+ printf("\n");
+
printf("%s.\n", vm_record->uuid);
printf("Resident on %s.\n", (char *)vm_record->resident_on->u.handle);
xen_string_string_map_free(versions);
free(dmesg);
xen_string_set_free(supported_bootloaders);
+ xen_string_set_free(capabilities);
print_vm_metrics(session, vm);
if (!session->ok)
'resident_VMs',
'host_CPUs',
'metrics',
+ 'capabilities',
'supported_bootloaders',
'API_version_major',
'API_version_minor',
return xen_api_success(XendNode.instance().get_host_cpu_refs())
def host_get_metrics(self, _, ref):
return xen_api_success(XendNode.instance().host_metrics_uuid)
+ def host_get_capabilities(self, session, host_ref):
+ return xen_api_success(XendNode.instance().get_capabilities())
def host_get_supported_bootloaders(self, session, host_ref):
return xen_api_success(['pygrub'])
'resident_VMs': dom.get_domain_refs(),
'host_CPUs': node.get_host_cpu_refs(),
'metrics': node.host_metrics_uuid,
+ 'capabilities': node.get_capabilities(),
'supported_bootloaders': 'pygrub'}
return xen_api_success(record)
def get_uuid(self):
return self.uuid
+ def get_capabilities(self):
+ return self.xc.xeninfo()['xen_caps'].split(" ")
+
#
# Host CPU Functions
#